﻿
using RTW.DAL;
using RTW.OA.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace RTW.OA.Areas.Common.Servers
{
    public class AssetTypeServers
    {
	    private readonly IRepository<asset_type> asset_typeRepository;

        public AssetTypeServers()
        {
            asset_typeRepository = new DapperRepository<asset_type>();

        }

        public List<asset_type> GetData()
        {
            var datas = asset_typeRepository.GetAllEnumerable();

					  			return datas.ToList();
        }

        public asset_type GetModelById(string id)
        {
            return asset_typeRepository.GetById(id);
        }

		
        internal void Add(asset_type model)
        {
            asset_typeRepository.Insert(model);
        }

        internal void Update(asset_type model)
        {
            asset_typeRepository.Update(model);
        }

		internal void Del(string id)
        {
            asset_typeRepository.DeleteByIds(id);
        }

				      	}
}